home *** CD-ROM | disk | FTP | other *** search
/ SGI Developer Toolbox 6.1 / SGI Developer Toolbox 6.1 - Disc 4.iso / src / exampleCode / stereo / GL_5.2 / onoffstereo.c < prev    next >
Encoding:
C/C++ Source or Header  |  1994-08-02  |  1.6 KB  |  67 lines

  1. /*
  2.  * Copyright (C) 1991, 1992, 1993, 1994, Silicon Graphics, Inc.
  3.  * All Rights Reserved.
  4.  *
  5.  * This is UNPUBLISHED PROPRIETARY SOURCE CODE of Silicon Graphics, Inc.;
  6.  * the contents of this file may not be disclosed to third parties, copied or
  7.  * duplicated in any form, in whole or in part, without the prior written
  8.  * permission of Silicon Graphics, Inc.
  9.  *
  10.  * RESTRICTED RIGHTS LEGEND:
  11.  * Use, duplication or disclosure by the Government is subject to restrictions
  12.  * as set forth in subdivision (c)(1)(ii) of the Rights in Technical Data
  13.  * and Computer Software clause at DFARS 252.227-7013, and/or in similar or
  14.  * successor clauses in the FAR, DOD or NASA FAR Supplement. Unpublished -
  15.  * rights reserved under the Copyright Laws of the United States.
  16.  */
  17. #include "stereo.h"
  18.  
  19. /*
  20.  * Re-defined in on_stereo; in the future, should be initialized by a
  21.  * call to getgdesc().
  22.  */
  23. int YMAXSTEREO = (-1);
  24. int YOFFSET = (-1);
  25.  
  26. static int old_monitor_mode = (-1);
  27.  
  28. void
  29. stereo_on(int primary)
  30. {
  31.     if (primary == STR_RECT)
  32.         YOFFSET = 532;
  33.     else if (primary == STR_BOT)
  34.         YOFFSET = 532;
  35.     else if (primary == STR_TOP)
  36.         YOFFSET = -532;
  37.  
  38.     YMAXSTEREO = 491;
  39.  
  40.     /* If stereo is supported... */
  41.     if (getgdesc(GD_STEREO))
  42.     {
  43.         /* save old monitor mode (normally HZ60) */
  44.         old_monitor_mode = getmonitor();
  45.  
  46.         if (old_monitor_mode != primary)
  47.         {
  48.                     if(!getenv ("DISABLE_SETMON"))
  49.             setmonitor(primary);
  50.             if (old_monitor_mode == STR_TOP)
  51.                 old_monitor_mode = STR_BOT;
  52.         }
  53.     }
  54. }
  55.  
  56. void
  57. stereo_off()
  58. {
  59.     int mousey;
  60.  
  61.     if (old_monitor_mode != (-1) && old_monitor_mode != STR_RECT)
  62.     {
  63.         setmonitor(old_monitor_mode);
  64.         mousey = getvaluator(MOUSEY);
  65.     }
  66. }
  67.